//
//  MXFindSevenTableViewCell.m
//  MXの衣柜
//
//  Created by 马霄 on 15/8/14.
//  Copyright (c) 2015年 霄 马. All rights reserved.
//

#import "MXFindSevenTableViewCell.h"
#import "UIImageView+WebCache.h"
@implementation MXFindSevenTableViewCell

- (void)dealloc
{
    [_mainImageView release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.mainImageView = [[[UIImageView alloc] init] autorelease];
        self.mainImageView.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.mainImageView];
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    
    CGFloat WID = self.frame.size.width;
    
    CGFloat mainImageViewX = 0;
    CGFloat mainImageViewY = 0;
    CGFloat mainImageViewW = WID;
    CGFloat mainImageViewH = HEIGHTPRO * 400;
    self.mainImageView.frame = CGRectMake(mainImageViewX, mainImageViewY, mainImageViewW, mainImageViewH);
}


-(void)setModel:(MXFindDetailModel *)model
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    
    NSString *urlString = [model.article stringByReplacingOccurrencesOfString:@"|" withString:@""];
    
    [self.mainImageView sd_setImageWithURL:[NSURL URLWithString:urlString]placeholderImage:[UIImage imageNamed:@"plaseholder"]];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
